/**
 * 
 */
package cn.gov.msa.service;

import java.util.List;

import org.springframework.stereotype.Service;

import cn.gov.msa.model.AuditOpinion;
import cn.gov.msa.model.Flow;
import cn.gov.msa.model.FlowBusiness;
import cn.gov.msa.model.FlowNextNode;
import cn.gov.msa.model.FlowNextNodeE;
import cn.gov.msa.model.FlowNode;
import cn.gov.msa.model.FlowNodeParam;
import cn.gov.msa.model.FlowTaskUser;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;



/**
 * @author 何宇江
 *2018-2-8
 */

@Service
public interface FlowService {

	public List<Flow> selectData(int currentPage, int pageRecord, Flow flow) throws Exception;
	
	public List<FlowNode> getNodes(String id) throws Exception;

	public List<FlowNextNodeE> getNextNodes(String nodecode) throws Exception;
	
	public Flow getInfoByID(String id) throws Exception;
	
	public boolean save(Flow flow, List<FlowNode> flowNodeList, List<FlowNextNode> flowNextNodeList) throws Exception;
	
	public boolean saveNextNode(JSONObject param);
	public boolean saveNextNode(String nodecode, List<FlowNextNode> flowNextNodeList) throws Exception;

	public boolean delete(String id) throws Exception;

	public boolean updateData(Flow flow, List<FlowNode> flowNodeList, List<FlowNextNode> flowNextNodeList) throws Exception;

	public boolean saveFlowBusiness(FlowBusiness flowBusiness, List<FlowNodeParam> flowNodeParamList) throws Exception;

	public String startFlow(String flownumber, String businessid, String businessnumber, String nodecode, String orgcode, String senduserid, String sendusername,String itemno,String applyno,String itemname,String orgname) throws Exception;
	
	public boolean saveAuditOpinion(AuditOpinion auditOpinion,List<FlowTaskUser> flowTaskUserList,JSONArray annexids,FlowNode nextflownode,String taskuserid,String itemno,String applyno,String proposerid,String itemname,String orgname) throws Exception;

	
	public FlowNode getFistNode(String flownumber) throws Exception;

	public FlowNode getAcceptNode(String flownumber) throws Exception;

	public void saveJointlySignOpinion(AuditOpinion auditOpinion, List<FlowTaskUser> flowTaskUserList, JSONArray annexids,String taskuserid) throws Exception;
}
